package com.ccl.bigevent.anno;

import com.ccl.bigevent.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

/**
 * @Title: State
 * @Author ccl
 * @Package IntelliJ IDEA
 * @Date 2024/10/26 14:03
 * @description:
 */


@Documented
@Constraint(
        validatedBy = {StateValidation.class}
)
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface State {

    // 校验失败后返回的错误信息
    String message() default "state参数的值只能是“已发布”或“草稿”";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
